package controllers;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import models.Region;
import models.SystemAuthority;
import models.SystemMenu;
import services.AuthorityService;
import services.RegionService;
import services.RoleMenuService;
import utils.Node;

public class RegionController extends BaseController {
	/**
	 * 获取地区
	 *
	 * @Title: getRegion 
	 * @return: void
	 */
	public static void getRegion(String pid){
		LinkedList<Region> regions=new LinkedList<Region>();
		if(StringUtils.isEmpty(pid)){
			regions=RegionService.getFRegion();
			Region region =new Region("","请选择");
			regions.addFirst(region);
		}
		else{
			regions=RegionService.getRegion(pid);
		}
    	renderJSON(regions);
	}
}
